<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/functions"  prefix="fn"%> 
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
  <!-- 
    <base href="<%=basePath + "admin/"%>">
    --> 
    <title>编辑</title>
	<meta http-equiv="pragma" content="no-cache">
	<meta http-equiv="cache-control" content="no-cache">
	<meta http-equiv="expires" content="0">    
	<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
	<meta http-equiv="description" content="This is my page">

  </head>
  
  <body>
    <form action="${target }" enctype="multipart/form-data" method="post">
    	<input name="id" type="hidden" value="${product.id }" />
    	产品名称：<input name="name" value="${product.name }" /><br/>
    	产品类型：<select name="type">
    		<c:forEach items="${list }" var="t">
    			<c:choose>
    				<c:when test="${product.producttype.id == t.id }">
						<option value="${t.id }" selected="selected">${t.name }</option>    					
    				</c:when>
    				<c:otherwise>
    					<option value="${t.id }">${t.name }</option>
    				</c:otherwise>
    			</c:choose>
    		</c:forEach>
    	</select><br/>
    	产品备注：<textarea name="remark" rows="20" cols="70">${fn:replace(fn:replace(product.remark, "<pre>", ""), "</pre>", "")}</textarea><br/>
    	图片: 
    	<c:if test="${fn:length(product.image) > 0 }">
    		<img src="<%=basePath %>upload/images/${product.image }" title="${product.name }" alt="${product.name }" height="100" width="100"/><br/>
    	</c:if>
    	<input name="file" type="file" />
    	<input name="image" type="hidden" value="${product.image }"/>
    	<br/>
    	
   		大图：
   		<c:if test="${fn:length(product.bigImage) > 0 }">
   			<img src="<%=basePath %>upload/images/${product.bigImage }" title="${product.bigImage }" alt="${product.bigImage }" height="100" width="100"/><br/>
   		</c:if>
   		<input name="file2" type="file" />
   		<input name="bigImage" type="hidden" value="${product.bigImage }"/><br/>
    	
    	<input type="submit" value="提交" /><input type="button" value="返回" onclick="history.go(-1)">
    </form>
	

  </body>
</html>
